import flash.net.URLLoader;

import mx.collections.ArrayCollection;

[Bindable]
public var dataProvider:ArrayCollection=new ArrayCollection();

[Bindable]
public var transportModes_dp:ArrayCollection=new ArrayCollection();



[Bindable]
private var styleSheet:StyleSheet;


public function creationComplete():void
{
	var item:Object;
	for (var i:Object in data_a)
	{
		item=new Object();
		item=data_a[i];
		item.totalCost=data_a[i].cost;
		dataProvider.addItem(item);
	}
	
	for (i in pTrans_data)
	{
		item=new Object();
		item=pTrans_data[i];
		item.incrementalCost=0;
		transportModes_dp.addItem(item);		
	}

    var urlLoader:URLLoader=new URLLoader();
    urlLoader.addEventListener(Event.COMPLETE, urlLoader_complete);
    urlLoader.load(new URLRequest("org/quantitativesustainability/styles/default.css"));
    
    qsChart.init(dataProvider); 
    pTrans_chart.init(transportModes_dp);
    
    activeChart=charts_tn.selectedChild.getChildren()[0];
    
    info.acc.selectedChild=info.discussion;
    activeChart.updateCarbonPrice(0);
}//init();

private function urlLoader_complete(evt:Event):void
{
    var css:String=URLLoader(evt.currentTarget).data;
    styleSheet=new StyleSheet();
    styleSheet.parseCSS(css);
}

